﻿using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using WjAutoConfigApp.Models;

namespace WjAutoConfigApp
{
    /// <summary>
    /// 所画区域的模型
    /// </summary>
    public class AreaModel
    {
        public Color PenColor { get; set; }

        /// <summary>
        /// 是否已保存，已经保存的就不能再回退画图了。
        /// </summary>
        public bool IsSaved { get; set; }

        /// <summary>
        /// 
        /// </summary>
        public bool IsLaneArea { get; set; }

        /// <summary>
        /// 车道区域信息
        /// </summary>
        public LaneAllPropertyModel LaneInfoModel { get; set; }


        /// <summary>
        /// 局部属性信息
        /// </summary>
        public LanePartPropertyModel PropertyInfoModel { get; set; }


        /// <summary>
        /// 区域点
        /// </summary>
        public List<Point> Points { get; set; } = new List<Point>();

        /// <summary>
        /// 完善这个区域信息
        /// </summary>
        /// <param name="color"></param>
        /// <param name="isSaved"></param>
        /// <returns></returns>
        public AreaModel PerfectModel (Color color,bool isSaved = false)
        {
            this.PenColor = color;
            return this;
        }

        /// <summary>
        /// 初始化
        /// </summary>
        public void InitAreaModel()
        {
            IsSaved = false;
            IsLaneArea = false;
            Points.Clear();
            PropertyInfoModel = null;
            LaneInfoModel = null;
        }
    }
}
